
// let title: string = '千峰教育'
// console.log(title)
//此文件编译
//tsc app.ts --outfile ../dist/app.js tsc --init 创建ts配置文件
//配置好tsconfig outDir 和 rootDir
//tsc --watch

// function greeter(person: string) {
//     return 'hello' + person
// }
// let user = 'susu'
// console.log(greeter(user))

//定义接口类型
// interface Person{
//     firstName:string
//     lastName:string
// }
// function greeter(person:Person){
//     return "hello," + person.firstName + '' + person.lastName
// }
// let user ={
//     firstName:'2',
//     lastName:'rongTao'
// }
// greeter(user)

//类
// class Student {
//     fullName: string =''
//     constructor(public firstName:string,public lastName:string){
//         this.fullName = this.firstName + this.lastName
//     }
// }
// // 实例化类
// let student = new Student('w','s')
// console.log(student)
/**
 * ts 数据类型
 * boolean
 * number
 * string
 * Array<string>
 */


// let isDone: boolean = false
// console.log(isDone)

// let dec :number =1
// let from:string = '千峰教育'
// from = '好程序员'
// let age:number =3
// // console.log(from)
// let s : string =`${from} ${age}`
// console.log(s)

//符合数据类型数组

// let list: number[] = [1, 2]
// // 泛型
// let list2: Array<string>=['w','s']

//元组 就是站位的什么类型 就必须传什么类型 不能颠倒顺序
let x:[string,number]
x =['hello',89]
console.log(x[0].slice(1))
// console.log(x)